package com.burges.net.ml.dataPreHandle

import org.apache.flink.api.scala.{DataSet, ExecutionEnvironment}
import org.apache.flink.ml.common.LabeledVector
import org.apache.flink.ml.preprocessing.PolynomialFeatures

/**
  * 创建人    BurgessLee 
  * 创建时间   2020/2/27 
  * 描述     多项式特征处理实例代码
  */
object PolynomialCharacteristicDemo {

	def main(args: Array[String]): Unit = {
		val environment = ExecutionEnvironment.getExecutionEnvironment
		//获取训练数据集
		val trainingDs: DataSet[LabeledVector] = environment.fromElements(LabeledVector(1.2, Vector()))
		//设定多项式转换维度3
		val polynomialFeatures = PolynomialFeatures().setDegree(3)
		//进行特征转换
		polynomialFeatures.fit(trainingDs)
	}

}
